package com.angel.mocks.architecture.services.impl;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.angel.architecture.annotations.services.GenericDAO;
import com.angel.architecture.persistence.base.PersistentObject;
import com.angel.architecture.services.impl.GenericServiceImpl;
import com.angel.mocks.architecture.services.AddressService;
import com.angel.mocks.daos.AddressDAO;
import com.angel.mocks.providers.Address;

@Service
@GenericDAO( daoName = "addressDAO")
public class AddressServiceImpl extends GenericServiceImpl implements AddressService{

	@Autowired
	private AddressDAO addressDAO;

	public Address findUniqueByStreetAndNumber(String streetName, Integer number) {
		return this.addressDAO.findUniqueByStreetAndNumber(streetName, number);
	}

	public PersistentObject create(PersistentObject persistentObject) {
		return this.addressDAO.persist((Address) persistentObject);
	}
}
